{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "84dc6ec4",
   "metadata": {},
   "source": [
    "# 分别随机生成六个班的考试成绩，每个班50人，考试共三门：Python、数学、语文。每个班级成绩的shape应当是50x3 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "id": "2174d666",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "id": "deb6ec6b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[array([[65,  7, 78],\n",
       "        [66, 81, 81],\n",
       "        [26,  2,  7],\n",
       "        [46, 60, 84],\n",
       "        [89, 98, 57],\n",
       "        [15, 91, 36],\n",
       "        [36, 99, 65],\n",
       "        [ 0,  6, 13],\n",
       "        [47,  9, 42],\n",
       "        [47, 20, 44],\n",
       "        [46, 11, 90],\n",
       "        [10, 22, 85],\n",
       "        [84, 96, 35],\n",
       "        [ 9, 58, 37],\n",
       "        [87, 90,  9],\n",
       "        [19, 41, 65],\n",
       "        [ 1, 42, 88],\n",
       "        [14,  9, 27],\n",
       "        [45, 69, 60],\n",
       "        [67, 93, 86],\n",
       "        [ 4, 60, 90],\n",
       "        [23, 84, 16],\n",
       "        [71, 75, 67],\n",
       "        [63, 93, 39],\n",
       "        [36, 41, 82],\n",
       "        [94, 57, 80],\n",
       "        [79, 92, 71],\n",
       "        [94, 93, 92],\n",
       "        [87, 70, 93],\n",
       "        [58, 30, 20],\n",
       "        [54, 72, 26],\n",
       "        [59, 33, 82],\n",
       "        [75, 79, 46],\n",
       "        [78, 43,  3],\n",
       "        [89, 96, 19],\n",
       "        [90, 43, 42],\n",
       "        [34, 99, 71],\n",
       "        [54, 49, 17],\n",
       "        [68,  9,  7],\n",
       "        [95, 69, 23],\n",
       "        [12, 73, 68],\n",
       "        [ 6, 82, 87],\n",
       "        [38, 98, 28],\n",
       "        [82,  4, 49],\n",
       "        [10,  5, 98],\n",
       "        [49, 87, 35],\n",
       "        [13, 58, 53],\n",
       "        [31, 92, 38],\n",
       "        [18, 96, 22],\n",
       "        [50,  5, 58]]),\n",
       " array([[13, 42,  6],\n",
       "        [77, 85, 38],\n",
       "        [83, 61, 14],\n",
       "        [67, 44, 37],\n",
       "        [60, 18,  8],\n",
       "        [85,  1,  9],\n",
       "        [ 3, 96, 19],\n",
       "        [80, 21, 10],\n",
       "        [ 2, 70, 58],\n",
       "        [54, 35, 16],\n",
       "        [29, 11, 92],\n",
       "        [56, 70, 21],\n",
       "        [49, 75, 64],\n",
       "        [97, 39,  5],\n",
       "        [95, 50, 51],\n",
       "        [84, 85,  5],\n",
       "        [54, 23, 19],\n",
       "        [15, 25, 74],\n",
       "        [69, 51, 19],\n",
       "        [90, 26, 42],\n",
       "        [12, 75,  5],\n",
       "        [95, 83, 76],\n",
       "        [98,  1, 29],\n",
       "        [45, 86, 37],\n",
       "        [ 6, 62, 84],\n",
       "        [26, 58, 94],\n",
       "        [12, 33, 36],\n",
       "        [44, 21, 75],\n",
       "        [36,  6, 66],\n",
       "        [52, 25, 44],\n",
       "        [65, 85, 73],\n",
       "        [45,  3, 44],\n",
       "        [38, 81, 61],\n",
       "        [81, 11, 50],\n",
       "        [63, 84,  7],\n",
       "        [12, 41, 69],\n",
       "        [47, 72, 28],\n",
       "        [15, 72, 73],\n",
       "        [42, 95, 65],\n",
       "        [50, 26, 56],\n",
       "        [44, 39, 80],\n",
       "        [67, 72,  3],\n",
       "        [77, 41, 59],\n",
       "        [22, 23, 88],\n",
       "        [46, 65, 22],\n",
       "        [38,  6, 27],\n",
       "        [59, 41, 22],\n",
       "        [85, 40, 23],\n",
       "        [41, 23, 11],\n",
       "        [45, 21,  9]]),\n",
       " array([[49, 90, 19],\n",
       "        [40, 79, 90],\n",
       "        [72, 51, 33],\n",
       "        [98, 95, 70],\n",
       "        [57, 75, 70],\n",
       "        [37, 40,  5],\n",
       "        [34, 24, 67],\n",
       "        [24, 14, 71],\n",
       "        [59, 24,  6],\n",
       "        [50, 37, 67],\n",
       "        [34, 97,  4],\n",
       "        [56, 98, 11],\n",
       "        [48,  8, 26],\n",
       "        [15, 14, 13],\n",
       "        [ 4, 90, 17],\n",
       "        [73, 82,  6],\n",
       "        [74, 53, 51],\n",
       "        [88, 76, 37],\n",
       "        [87, 28, 52],\n",
       "        [60, 27, 22],\n",
       "        [97, 44, 90],\n",
       "        [24, 56, 42],\n",
       "        [22, 22, 68],\n",
       "        [72, 33, 77],\n",
       "        [86, 26, 59],\n",
       "        [90, 51, 48],\n",
       "        [91, 79, 83],\n",
       "        [37, 50, 25],\n",
       "        [98, 35, 88],\n",
       "        [51, 76, 46],\n",
       "        [65, 14, 20],\n",
       "        [75, 75, 22],\n",
       "        [15, 62,  4],\n",
       "        [95, 89, 26],\n",
       "        [30, 79, 77],\n",
       "        [23, 53, 96],\n",
       "        [74, 40, 48],\n",
       "        [14, 80, 25],\n",
       "        [94, 15,  1],\n",
       "        [98, 47, 39],\n",
       "        [89, 54, 82],\n",
       "        [68,  4, 88],\n",
       "        [43, 56, 97],\n",
       "        [91,  7, 64],\n",
       "        [25, 45, 99],\n",
       "        [18, 12, 83],\n",
       "        [43, 51, 28],\n",
       "        [81, 62, 12],\n",
       "        [35, 65, 12],\n",
       "        [44, 92, 68]]),\n",
       " array([[43,  6, 34],\n",
       "        [29, 30, 77],\n",
       "        [20, 45, 81],\n",
       "        [50, 38, 89],\n",
       "        [34, 10, 28],\n",
       "        [ 5, 20, 28],\n",
       "        [ 4, 76, 40],\n",
       "        [ 1, 47,  0],\n",
       "        [21, 79, 13],\n",
       "        [68, 63, 79],\n",
       "        [11, 40, 37],\n",
       "        [82, 25, 38],\n",
       "        [83, 72,  1],\n",
       "        [35, 99, 61],\n",
       "        [65, 70, 19],\n",
       "        [96, 62, 11],\n",
       "        [90,  1, 75],\n",
       "        [80, 61, 15],\n",
       "        [86, 98, 69],\n",
       "        [77, 61, 10],\n",
       "        [49,  3, 72],\n",
       "        [48, 90,  7],\n",
       "        [ 0, 27, 43],\n",
       "        [97, 32, 86],\n",
       "        [96, 77, 66],\n",
       "        [ 3, 32,  5],\n",
       "        [ 9, 25, 39],\n",
       "        [22, 42, 12],\n",
       "        [77, 22, 34],\n",
       "        [ 1,  0, 18],\n",
       "        [58, 85, 27],\n",
       "        [30, 31, 47],\n",
       "        [81, 88, 82],\n",
       "        [40, 33, 16],\n",
       "        [ 2, 20, 36],\n",
       "        [ 6, 84, 34],\n",
       "        [16, 90, 39],\n",
       "        [10, 74, 95],\n",
       "        [79, 23, 13],\n",
       "        [20, 97, 82],\n",
       "        [82, 45, 53],\n",
       "        [ 7,  6, 57],\n",
       "        [ 1, 14, 27],\n",
       "        [57, 76, 32],\n",
       "        [70, 44,  5],\n",
       "        [89, 15, 29],\n",
       "        [74, 43,  6],\n",
       "        [22, 75, 97],\n",
       "        [ 5, 20, 27],\n",
       "        [26, 17, 54]]),\n",
       " array([[19, 78, 79],\n",
       "        [47, 66, 56],\n",
       "        [10, 76, 38],\n",
       "        [85, 22, 26],\n",
       "        [ 4, 38, 99],\n",
       "        [18, 90, 28],\n",
       "        [28, 88, 46],\n",
       "        [17, 93, 90],\n",
       "        [12,  4,  7],\n",
       "        [96, 77, 91],\n",
       "        [81, 91, 87],\n",
       "        [60, 46,  9],\n",
       "        [70, 54, 49],\n",
       "        [36, 99, 13],\n",
       "        [19, 22, 88],\n",
       "        [44, 19, 50],\n",
       "        [40, 27, 32],\n",
       "        [73, 51, 97],\n",
       "        [30, 82, 21],\n",
       "        [51, 56, 27],\n",
       "        [41, 68, 74],\n",
       "        [75, 52, 99],\n",
       "        [20, 68, 62],\n",
       "        [90, 30, 24],\n",
       "        [98,  1, 92],\n",
       "        [ 3, 84, 76],\n",
       "        [67, 42, 90],\n",
       "        [20, 93, 55],\n",
       "        [48, 33, 61],\n",
       "        [58, 40,  3],\n",
       "        [72, 99, 18],\n",
       "        [67, 94, 72],\n",
       "        [62, 48,  2],\n",
       "        [64, 30, 75],\n",
       "        [38, 13, 53],\n",
       "        [87, 47, 56],\n",
       "        [12, 48, 53],\n",
       "        [ 9, 62, 43],\n",
       "        [52,  7, 31],\n",
       "        [71, 58, 26],\n",
       "        [11,  8, 31],\n",
       "        [ 7, 87, 56],\n",
       "        [44,  7, 40],\n",
       "        [89, 32, 60],\n",
       "        [59, 18, 56],\n",
       "        [19, 72, 40],\n",
       "        [23, 20, 68],\n",
       "        [50, 61, 80],\n",
       "        [55, 99, 38],\n",
       "        [35, 40, 28]]),\n",
       " array([[87, 91,  9],\n",
       "        [10,  6, 85],\n",
       "        [69, 92, 15],\n",
       "        [10, 59, 20],\n",
       "        [42, 67, 17],\n",
       "        [13, 87, 95],\n",
       "        [40, 55, 81],\n",
       "        [19,  4, 58],\n",
       "        [35,  2, 87],\n",
       "        [ 3,  7, 70],\n",
       "        [77, 68, 85],\n",
       "        [22, 95, 33],\n",
       "        [33, 95, 12],\n",
       "        [76, 22, 59],\n",
       "        [84,  2, 21],\n",
       "        [28, 96, 98],\n",
       "        [43, 95, 97],\n",
       "        [32, 97,  2],\n",
       "        [60, 52, 96],\n",
       "        [13, 63, 56],\n",
       "        [71, 99, 73],\n",
       "        [60, 56, 98],\n",
       "        [15, 48, 63],\n",
       "        [86, 75, 51],\n",
       "        [24, 59, 94],\n",
       "        [ 6,  3,  0],\n",
       "        [17,  3, 68],\n",
       "        [ 7,  4,  5],\n",
       "        [69,  2, 94],\n",
       "        [63, 67,  0],\n",
       "        [76, 32, 51],\n",
       "        [73, 41, 51],\n",
       "        [62, 52, 60],\n",
       "        [48, 62, 44],\n",
       "        [94, 70, 44],\n",
       "        [55, 38, 26],\n",
       "        [59, 59, 93],\n",
       "        [34, 39, 32],\n",
       "        [10, 15, 60],\n",
       "        [21, 99, 13],\n",
       "        [84, 86, 93],\n",
       "        [63, 86,  0],\n",
       "        [23, 22, 25],\n",
       "        [55, 27, 84],\n",
       "        [66, 61, 43],\n",
       "        [ 7, 19, 47],\n",
       "        [17, 98, 58],\n",
       "        [99, 16, 72],\n",
       "        [18, 30, 43],\n",
       "        [33, 98, 64]])]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "class_group = []\n",
    "for i in range(6):\n",
    "    class_score = np.random.randint(0,100,size=(50,3))\n",
    "    class_group.append(class_score)\n",
    "display(class_group)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "60ab8503",
   "metadata": {},
   "source": [
    "# 将这六个班的考试成绩垂直叠加得到二维数组score。(即score的每一行是一个同学的成绩)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "id": "34da7436",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[65,  7, 78],\n",
       "       [66, 81, 81],\n",
       "       [26,  2,  7],\n",
       "       [46, 60, 84],\n",
       "       [89, 98, 57],\n",
       "       [15, 91, 36],\n",
       "       [36, 99, 65],\n",
       "       [ 0,  6, 13],\n",
       "       [47,  9, 42],\n",
       "       [47, 20, 44],\n",
       "       [46, 11, 90],\n",
       "       [10, 22, 85],\n",
       "       [84, 96, 35],\n",
       "       [ 9, 58, 37],\n",
       "       [87, 90,  9],\n",
       "       [19, 41, 65],\n",
       "       [ 1, 42, 88],\n",
       "       [14,  9, 27],\n",
       "       [45, 69, 60],\n",
       "       [67, 93, 86],\n",
       "       [ 4, 60, 90],\n",
       "       [23, 84, 16],\n",
       "       [71, 75, 67],\n",
       "       [63, 93, 39],\n",
       "       [36, 41, 82],\n",
       "       [94, 57, 80],\n",
       "       [79, 92, 71],\n",
       "       [94, 93, 92],\n",
       "       [87, 70, 93],\n",
       "       [58, 30, 20],\n",
       "       [54, 72, 26],\n",
       "       [59, 33, 82],\n",
       "       [75, 79, 46],\n",
       "       [78, 43,  3],\n",
       "       [89, 96, 19],\n",
       "       [90, 43, 42],\n",
       "       [34, 99, 71],\n",
       "       [54, 49, 17],\n",
       "       [68,  9,  7],\n",
       "       [95, 69, 23],\n",
       "       [12, 73, 68],\n",
       "       [ 6, 82, 87],\n",
       "       [38, 98, 28],\n",
       "       [82,  4, 49],\n",
       "       [10,  5, 98],\n",
       "       [49, 87, 35],\n",
       "       [13, 58, 53],\n",
       "       [31, 92, 38],\n",
       "       [18, 96, 22],\n",
       "       [50,  5, 58],\n",
       "       [13, 42,  6],\n",
       "       [77, 85, 38],\n",
       "       [83, 61, 14],\n",
       "       [67, 44, 37],\n",
       "       [60, 18,  8],\n",
       "       [85,  1,  9],\n",
       "       [ 3, 96, 19],\n",
       "       [80, 21, 10],\n",
       "       [ 2, 70, 58],\n",
       "       [54, 35, 16],\n",
       "       [29, 11, 92],\n",
       "       [56, 70, 21],\n",
       "       [49, 75, 64],\n",
       "       [97, 39,  5],\n",
       "       [95, 50, 51],\n",
       "       [84, 85,  5],\n",
       "       [54, 23, 19],\n",
       "       [15, 25, 74],\n",
       "       [69, 51, 19],\n",
       "       [90, 26, 42],\n",
       "       [12, 75,  5],\n",
       "       [95, 83, 76],\n",
       "       [98,  1, 29],\n",
       "       [45, 86, 37],\n",
       "       [ 6, 62, 84],\n",
       "       [26, 58, 94],\n",
       "       [12, 33, 36],\n",
       "       [44, 21, 75],\n",
       "       [36,  6, 66],\n",
       "       [52, 25, 44],\n",
       "       [65, 85, 73],\n",
       "       [45,  3, 44],\n",
       "       [38, 81, 61],\n",
       "       [81, 11, 50],\n",
       "       [63, 84,  7],\n",
       "       [12, 41, 69],\n",
       "       [47, 72, 28],\n",
       "       [15, 72, 73],\n",
       "       [42, 95, 65],\n",
       "       [50, 26, 56],\n",
       "       [44, 39, 80],\n",
       "       [67, 72,  3],\n",
       "       [77, 41, 59],\n",
       "       [22, 23, 88],\n",
       "       [46, 65, 22],\n",
       "       [38,  6, 27],\n",
       "       [59, 41, 22],\n",
       "       [85, 40, 23],\n",
       "       [41, 23, 11],\n",
       "       [45, 21,  9],\n",
       "       [49, 90, 19],\n",
       "       [40, 79, 90],\n",
       "       [72, 51, 33],\n",
       "       [98, 95, 70],\n",
       "       [57, 75, 70],\n",
       "       [37, 40,  5],\n",
       "       [34, 24, 67],\n",
       "       [24, 14, 71],\n",
       "       [59, 24,  6],\n",
       "       [50, 37, 67],\n",
       "       [34, 97,  4],\n",
       "       [56, 98, 11],\n",
       "       [48,  8, 26],\n",
       "       [15, 14, 13],\n",
       "       [ 4, 90, 17],\n",
       "       [73, 82,  6],\n",
       "       [74, 53, 51],\n",
       "       [88, 76, 37],\n",
       "       [87, 28, 52],\n",
       "       [60, 27, 22],\n",
       "       [97, 44, 90],\n",
       "       [24, 56, 42],\n",
       "       [22, 22, 68],\n",
       "       [72, 33, 77],\n",
       "       [86, 26, 59],\n",
       "       [90, 51, 48],\n",
       "       [91, 79, 83],\n",
       "       [37, 50, 25],\n",
       "       [98, 35, 88],\n",
       "       [51, 76, 46],\n",
       "       [65, 14, 20],\n",
       "       [75, 75, 22],\n",
       "       [15, 62,  4],\n",
       "       [95, 89, 26],\n",
       "       [30, 79, 77],\n",
       "       [23, 53, 96],\n",
       "       [74, 40, 48],\n",
       "       [14, 80, 25],\n",
       "       [94, 15,  1],\n",
       "       [98, 47, 39],\n",
       "       [89, 54, 82],\n",
       "       [68,  4, 88],\n",
       "       [43, 56, 97],\n",
       "       [91,  7, 64],\n",
       "       [25, 45, 99],\n",
       "       [18, 12, 83],\n",
       "       [43, 51, 28],\n",
       "       [81, 62, 12],\n",
       "       [35, 65, 12],\n",
       "       [44, 92, 68],\n",
       "       [43,  6, 34],\n",
       "       [29, 30, 77],\n",
       "       [20, 45, 81],\n",
       "       [50, 38, 89],\n",
       "       [34, 10, 28],\n",
       "       [ 5, 20, 28],\n",
       "       [ 4, 76, 40],\n",
       "       [ 1, 47,  0],\n",
       "       [21, 79, 13],\n",
       "       [68, 63, 79],\n",
       "       [11, 40, 37],\n",
       "       [82, 25, 38],\n",
       "       [83, 72,  1],\n",
       "       [35, 99, 61],\n",
       "       [65, 70, 19],\n",
       "       [96, 62, 11],\n",
       "       [90,  1, 75],\n",
       "       [80, 61, 15],\n",
       "       [86, 98, 69],\n",
       "       [77, 61, 10],\n",
       "       [49,  3, 72],\n",
       "       [48, 90,  7],\n",
       "       [ 0, 27, 43],\n",
       "       [97, 32, 86],\n",
       "       [96, 77, 66],\n",
       "       [ 3, 32,  5],\n",
       "       [ 9, 25, 39],\n",
       "       [22, 42, 12],\n",
       "       [77, 22, 34],\n",
       "       [ 1,  0, 18],\n",
       "       [58, 85, 27],\n",
       "       [30, 31, 47],\n",
       "       [81, 88, 82],\n",
       "       [40, 33, 16],\n",
       "       [ 2, 20, 36],\n",
       "       [ 6, 84, 34],\n",
       "       [16, 90, 39],\n",
       "       [10, 74, 95],\n",
       "       [79, 23, 13],\n",
       "       [20, 97, 82],\n",
       "       [82, 45, 53],\n",
       "       [ 7,  6, 57],\n",
       "       [ 1, 14, 27],\n",
       "       [57, 76, 32],\n",
       "       [70, 44,  5],\n",
       "       [89, 15, 29],\n",
       "       [74, 43,  6],\n",
       "       [22, 75, 97],\n",
       "       [ 5, 20, 27],\n",
       "       [26, 17, 54],\n",
       "       [19, 78, 79],\n",
       "       [47, 66, 56],\n",
       "       [10, 76, 38],\n",
       "       [85, 22, 26],\n",
       "       [ 4, 38, 99],\n",
       "       [18, 90, 28],\n",
       "       [28, 88, 46],\n",
       "       [17, 93, 90],\n",
       "       [12,  4,  7],\n",
       "       [96, 77, 91],\n",
       "       [81, 91, 87],\n",
       "       [60, 46,  9],\n",
       "       [70, 54, 49],\n",
       "       [36, 99, 13],\n",
       "       [19, 22, 88],\n",
       "       [44, 19, 50],\n",
       "       [40, 27, 32],\n",
       "       [73, 51, 97],\n",
       "       [30, 82, 21],\n",
       "       [51, 56, 27],\n",
       "       [41, 68, 74],\n",
       "       [75, 52, 99],\n",
       "       [20, 68, 62],\n",
       "       [90, 30, 24],\n",
       "       [98,  1, 92],\n",
       "       [ 3, 84, 76],\n",
       "       [67, 42, 90],\n",
       "       [20, 93, 55],\n",
       "       [48, 33, 61],\n",
       "       [58, 40,  3],\n",
       "       [72, 99, 18],\n",
       "       [67, 94, 72],\n",
       "       [62, 48,  2],\n",
       "       [64, 30, 75],\n",
       "       [38, 13, 53],\n",
       "       [87, 47, 56],\n",
       "       [12, 48, 53],\n",
       "       [ 9, 62, 43],\n",
       "       [52,  7, 31],\n",
       "       [71, 58, 26],\n",
       "       [11,  8, 31],\n",
       "       [ 7, 87, 56],\n",
       "       [44,  7, 40],\n",
       "       [89, 32, 60],\n",
       "       [59, 18, 56],\n",
       "       [19, 72, 40],\n",
       "       [23, 20, 68],\n",
       "       [50, 61, 80],\n",
       "       [55, 99, 38],\n",
       "       [35, 40, 28],\n",
       "       [87, 91,  9],\n",
       "       [10,  6, 85],\n",
       "       [69, 92, 15],\n",
       "       [10, 59, 20],\n",
       "       [42, 67, 17],\n",
       "       [13, 87, 95],\n",
       "       [40, 55, 81],\n",
       "       [19,  4, 58],\n",
       "       [35,  2, 87],\n",
       "       [ 3,  7, 70],\n",
       "       [77, 68, 85],\n",
       "       [22, 95, 33],\n",
       "       [33, 95, 12],\n",
       "       [76, 22, 59],\n",
       "       [84,  2, 21],\n",
       "       [28, 96, 98],\n",
       "       [43, 95, 97],\n",
       "       [32, 97,  2],\n",
       "       [60, 52, 96],\n",
       "       [13, 63, 56],\n",
       "       [71, 99, 73],\n",
       "       [60, 56, 98],\n",
       "       [15, 48, 63],\n",
       "       [86, 75, 51],\n",
       "       [24, 59, 94],\n",
       "       [ 6,  3,  0],\n",
       "       [17,  3, 68],\n",
       "       [ 7,  4,  5],\n",
       "       [69,  2, 94],\n",
       "       [63, 67,  0],\n",
       "       [76, 32, 51],\n",
       "       [73, 41, 51],\n",
       "       [62, 52, 60],\n",
       "       [48, 62, 44],\n",
       "       [94, 70, 44],\n",
       "       [55, 38, 26],\n",
       "       [59, 59, 93],\n",
       "       [34, 39, 32],\n",
       "       [10, 15, 60],\n",
       "       [21, 99, 13],\n",
       "       [84, 86, 93],\n",
       "       [63, 86,  0],\n",
       "       [23, 22, 25],\n",
       "       [55, 27, 84],\n",
       "       [66, 61, 43],\n",
       "       [ 7, 19, 47],\n",
       "       [17, 98, 58],\n",
       "       [99, 16, 72],\n",
       "       [18, 30, 43],\n",
       "       [33, 98, 64]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "score = []\n",
    "for cs in class_group:\n",
    "#     第一次中间数组变量为空,需要先拿出第一个班的成绩数组进行赋值\n",
    "    if len(score) == 0:\n",
    "        score = cs\n",
    "    else:\n",
    "        score = np.vstack((score, cs))   \n",
    "display(score)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d916beb8",
   "metadata": {},
   "source": [
    "# 生成性别数组sex，水平叠加数组sex和score得到data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "id": "2dae494d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[65,  7, 78,  0],\n",
       "       [66, 81, 81,  1],\n",
       "       [26,  2,  7,  1],\n",
       "       ...,\n",
       "       [99, 16, 72,  0],\n",
       "       [18, 30, 43,  0],\n",
       "       [33, 98, 64,  0]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 初始化300行性别数据\n",
    "sex = np.random.randint(0,2,size=(300,1))\n",
    "score = np.hstack((score, sex))\n",
    "display(score)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "92b0b232",
   "metadata": {},
   "source": [
    "# 分性别计算各科成绩的统计指标：最小值、最大值、平均分、中位数、标准差"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "id": "cafe2478",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "python学科的最高分：99；最低分：0；平均分：48.35；中位数：48；标准差：29.116201。\n",
      "数学学科的最高分：99；最低分：0；平均分：51.27；中位数：51；标准差：30.428751。\n",
      "语文学科的最高分：99；最低分：0；平均分：47.58；中位数：45；标准差：29.283285。\n"
     ]
    }
   ],
   "source": [
    "score_subject = np.split(score, indices_or_sections=4, axis=1)\n",
    "score_python = score_subject[0]\n",
    "score_math = score_subject[1]\n",
    "score_Chinese = score_subject[2]\n",
    "print('python学科的最高分：%d；最低分：%d；平均分：%.2f；中位数：%d；标准差：%.6f。' % (score_python.max(), score_python.min(), np.mean(score_python),np.median(score_python),np.std(score_python)))\n",
    "print('数学学科的最高分：%d；最低分：%d；平均分：%.2f；中位数：%d；标准差：%.6f。' % (score_math.max(), score_math.min(), np.mean(score_math),np.median(score_math),np.std(score_math)))\n",
    "print('语文学科的最高分：%d；最低分：%d；平均分：%.2f；中位数：%d；标准差：%.6f。' % (score_Chinese.max(), score_Chinese.min(), np.mean(score_Chinese),np.median(score_Chinese),np.std(score_Chinese)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b3b40fd6",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
